package com.hx.jvm.jvm.gc;

public class Main2 {
    /**
     * JVM 参数： -verbose:gc -Xms20M -Xmx20M -Xmn10M -XX:+PrintGCDetails -XX:SurvivorRatio=8 -XX:PretenureSizeThreshold=3145728
     * <p>
     * 参数解析：-XX:PretenureSizeThreshold=3145728  -XX:PretenureSizeThreshold=3MB  不能写成这样不支持
     * 同时这个参数不能在Parallel Scavenge上使用
     * 所以要调整GC收集器  -XX:+UseSerialGC
     * 目的，使大于这个数值的对象直接进入老年代，避免在年前代中的Eden和Survivor中复制
     */
    public static void main(String[] args) {
        int _1MB = 1024 * 1024;
        byte[] allowcation1;
        allowcation1 = new byte[4 * _1MB];
    }

    /**
     *
     * Heap
     * 	 def new generation   total 9216K, used 1148K [0x00000000fec00000, 0x00000000ff600000, 0x00000000ff600000)
     * 	  eden space 8192K,  14% used [0x00000000fec00000, 0x00000000fed1f2b0, 0x00000000ff400000)
     * 	  from space 1024K,   0% used [0x00000000ff400000, 0x00000000ff400000, 0x00000000ff500000)
     * 	  to   space 1024K,   0% used [0x00000000ff500000, 0x00000000ff500000, 0x00000000ff600000)
     * 	 tenured generation   total 10240K, used 4096K [0x00000000ff600000, 0x0000000100000000, 0x0000000100000000)
     * 	   the space 10240K,  40% used [0x00000000ff600000, 0x00000000ffa00010, 0x00000000ffa00200, 0x0000000100000000)
     * 	 Metaspace       used 2712K, capacity 4486K, committed 4864K, reserved 1056768K
     * 	  class space    used 298K, capacity 386K, committed 512K, reserved 1048576K
     *
     *
     */
}
